 
cc.Class({
    extends: cc.Component,

    properties: {
        gundong_label:{
            default:null,
            type:cc.Node
        },
        protbalPreftab:{
            default:null,
            type:cc.Prefab
            
        },
        createRoom:{
            default:null,
            type:cc.Prefab
        }
    },

    // LIFE-CYCLE CALLBACKS:

    
     buttonClick(event,customData){
        console.log(customData);
        if(customData == "join"){
            let node = cc.instantiate(this.protbalPreftab);
            node.parent = this.node;
        }else if(customData == "create"){
            let node = cc.instantiate(this.createRoom);
            node.parent = this.node;
        }
     },
   
     update (dt) {
         this.gundong_label.position = cc.p(this.gundong_label.position.x -1,this.gundong_label.position.y);//跑马灯 右面位置保持不变，左边依次-1
         if(this.gundong_label.position.x < -700){
            this.gundong_label.position = cc.p(700,this.gundong_label.position.y);
         }
        
        },
});
